#ifndef TREE_H_
#define TREE_H_

#include "base.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef int TElemType;

#define MAX_TREE_SIZE	100
typedef TElemType SqBiTree[MAX_TREE_SIZE];

SqBiTree bt;

typedef struct BiTNode {
    TElemType	data;
    struct BiTNode *lchild;
    struct BiTNode *rchild;
} BiTNode, *BiTree;


typedef Status ( *Visit )( TElemType e );
Status output( TElemType e );

Status CreateTree( BiTree *T );
Status PreOrderTraverse( BiTree T, Visit pCallBack );
Status InOrderTraverse( BiTree T, Visit pCallBack );
Status PostOrderTraverse( BiTree T, Visit pCallBack );
Status LevelOrderTraverse( BiTree T, Visit pCallBack );

Status InOrderTraverseNoRecursion( BiTree T, Visit pCallBack );

#ifdef __cplusplus
}
#endif

#endif